home *** CD-ROM | disk | FTP | other *** search
- Path: crc-news.doc.ca!usenet
- From: Slobodan Celenkovic <Celenkovic.Bob@ic.gc.ca>
- Newsgroups: comp.lang.c++
- Subject: Re: Forward declarations: why won't they work?
- Date: 27 Mar 1996 21:45:24 GMT
- Organization: Industry Canada
- Message-ID: <4jcctk$2k9@crc-news.doc.ca>
- References: <4ivpp0$iut@hustle.rahul.net>
- NNTP-Posting-Host: bouhadrah.mohamed.bsd001.ic.gc.ca
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; U; 16bit)
-
- Theodore Sternberg <strnbrg@rahul.net> wrote:
- >Forward class declarations only seem to work sometimes. When they don't
- >work, I get a compiler error to the effect that "struct foo is an
- >imcomplete type". Can anyone tell me what's going on, i.e. when forward
- >class declarations are and are not possible?
-
- They always work. However the class must be defined eventually. Also I
- believe that you can only declare pointers to the class, because pointers
- are of fixed size. If you try to declare a class data member before class
- declaration then the compiler has no clue how much storage space is
- required!
-
-
-